package com.lzw.common.config;

import com.lzw.common.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by 林志伟 on 2017/6/19.
 */
@Configuration
public class LoginInterceptorConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**")//要拦截的请求
                .excludePathPatterns("/login","/kaptcha/get","/user/login");//不拦截的请求


    }
}
